package xyz.jangle.action;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import xyz.jangle.model.Demo;
import xyz.jangle.service.DemoService2;

@Controller
@RequestMapping("/demoCtrl2")
public class DemoCtrl2 {
	
	@Autowired
	private DemoService2 demoService;
	
	@RequestMapping("/insert.ctrl")
	@ResponseBody
	public Map<String, Object> insert(Demo record) {
		return demoService.insertOrUpdate(record);
	}
	
	@RequestMapping("/deleteByPrimaryKey.ctrl")
	@ResponseBody
	public Map<String, Object> deleteByPrimaryKey(Demo record) {
		return demoService.deleteByPrimaryKey(record);
	}
	
	@RequestMapping("/selectPage.ctrl")
	@ResponseBody
	public Map<String, Object> selectPage(Demo record) {
		return demoService.selectPage(record);
	}
	
	@RequestMapping("/selectByPrimaryKey.ctrl")
	@ResponseBody
	public Map<String, Object> selectByPrimaryKey(Demo record){
		return demoService.selectByPrimaryKey(record);
	}
	
	@RequestMapping("/batchDeleteByPrimaryKey.ctrl")
	@ResponseBody
	public Map<String, Object> batchDeleteByPrimaryKey(Demo record){
		return demoService.batchDeleteByPrimaryKey(record);
	}

}
